//
//  SingleLineInfoVC.m
//  EPTool
//
//  Created by guoshiqing on 2018/4/20.
//  Copyright © 2018年 云数动能科技. All rights reserved.
//

#import "SingleLineStaticInfoVC.h"
#import "UIView+DDAddition.h"
#import "GlobalUtil.h"

@interface SingleLineStaticInfoVC ()
@property (nonatomic, strong) UILabel *lblContent;
@property (nonatomic, strong) UILabel *lblDescMessage;
@end

@implementation SingleLineStaticInfoVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    [self addSubviews];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)addSubviews
{
    UIView *bkView = [[UIView alloc] initWithFrame:CGRectMake(0, 15.0f, UI_SCREEN_WIDTH, Cell_H)];
    bkView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:bkView];
    
    [bkView addSubview:self.lblContent];
    self.lblContent.centerY = bkView.height/2;
    
    [self.view addSubview:self.lblDescMessage];
    self.lblDescMessage.top = bkView.bottom + 5.0f;
}

- (void)setStrTitle:(NSString *)strTitle
{
    self.title = strTitle;
}

- (void)setStrContent:(NSString *)strContent
{
    self.lblContent.text = strContent;
}

- (void)setDescMessage:(NSString *)descMessage
{
    self.lblDescMessage.text = descMessage;
    CGSize size = [GlobalUtil sizeFortext:descMessage withFont:SystemFont(12.0f) constrainedToSize:CGSizeMake(Cell_W, Cell_W)];
    self.lblDescMessage.height = size.height;
}

#pragma mark - 懒加载
- (UILabel *)lblContent
{
    if (!_lblContent) {
        _lblContent = [[UILabel alloc] initWithFrame:CGRectMake(Cell_X, 0, Cell_W, 22.0f)];
        _lblContent.font = SystemFont(16.0f);
        _lblContent.textColor = [EPColor epColor_TitleBlack];
    }
    return _lblContent;
}

- (UILabel *)lblDescMessage
{
    if (!_lblDescMessage) {
        _lblDescMessage = [[UILabel alloc] initWithFrame:CGRectMake(Cell_X, 0, Cell_W, 17.0f)];
        _lblDescMessage.font = SystemFont(12.0f);
        _lblDescMessage.textColor = [EPColor epColor_descMessageGray];
        _lblDescMessage.backgroundColor = [UIColor clearColor];
        _lblDescMessage.numberOfLines = 0;
    }
    return _lblDescMessage;
}


@end
